import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref<number>(Number(localStorage.getItem("count")) as number ||0)   
   const name = ref<string>('Eduatdo')
  const doubleCount = computed(() => count.value + 2)
  function increment() {
    count.value++
    localStorage.setItem("count",String(count.value))
   
    
  }

  return { count, doubleCount, increment ,name}
})
